<?php
//ini_set('display_errors', '0');
//error_reporting(E_ALL | E_STRICT);
date_default_timezone_set('Asia/Shanghai'); 
define('ROOT', dirname(__file__));
//define('ENV', 'dev');

define('SQL_FILE',ROOT.'/logs/sql');
if(defined('ENV') && ENV)
{
    if(file_exists(ROOT . '/include/config.'.ENV.'.php'))
    {
        require (ROOT . '/include/config.'.ENV.'.php');
    }
    else
    {
        exit('请检查配置文件是否存在!');
    }
}
else
{
    $hostname=strtolower(php_uname('n'));
    if($hostname==='wireless_test')
    {
        $hostenv='test';
    }
    else if($hostname==='mobile_gamewave')
    {
        $hostenv='issue';
    }
    else
    {
        $hostenv='local';
    }
    if(file_exists(ROOT . '/include/config.'.$hostenv.'.php'))
    {
        require (ROOT . '/include/config.'.$hostenv.'.php');
    }
    else
    {
        exit('请检查配置文件是否存在!');
    }
}


require (ROOT . '/include/functions.php');
require (ROOT . '/controllers/controller.class.php');
require (ROOT . '/models/model.class.php');
